from scipy.integrate import quad

# 定义被积函数
def f(x):
    return x ** 3

# 计算定积分
result, error = quad(f, 0, 2)
print("定积分结果:", result)